<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
    xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers"
    xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers"
    xmlns:bu="http://typo3.org/ns/TYPO3/CMS/Beuser/ViewHelpers">

<f:layout name="Default" />

<f:section name="Buttons">
    <be:moduleLayout.button.linkButton
        icon="actions-view-go-back"
        title="{f:translate(id: 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.goBack')}"
        link="{be:moduleLink(route: 'system_BeuserTxBeuser')}"
    />
</f:section>

<f:section name="Content">
    <h1>{f:translate(key:'compareBackendUsers')}</h1>
    <div class="table-fit">
        <table id="tx_beuser_compare" class="table table-striped table-hover table-vertical-top">
            <thead>
                <tr>
                    <th></th>
                    <f:for each="{compareUserList}" as="compareData">
                        <th>
                            <a href="#" class="t3js-contextmenutrigger" data-table="be_users" data-uid="{compareData.user.uid}" title="id={compareData.user.uid}">
                                <be:avatar backendUser="{compareData.user.uid}" showIcon="true" />
                            </a>
                            {compareData.user.username}

                            <f:link.action action="removeFromCompareList" arguments="{uid: compareData.user.uid, redirectToCompare:1}" class="btn btn-default pull-right">
                                <core:icon identifier="actions-remove" size="small"/>
                            </f:link.action>
                            <be:link.editRecord class="btn btn-default pull-right" table="be_users" uid="{compareData.user.uid}" title="edit">
                                <core:icon identifier="actions-open" />
                            </be:link.editRecord>
                        </th>
                    </f:for>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <th><f:translate key="realName" /></th>
                    <f:for each="{compareUserList}" as="compareData">
                        <td>{compareData.user.realName}

                            <f:if condition="{compareData.user.email}">
                                (<f:link.email email="{compareData.user.email}" />)
                            </f:if>
                        </td>
                    </f:for>
                </tr>
                <tr>
                    <th>{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.recordInformation')}</th>
                    <f:for each="{compareUserList}" as="compareData">
                        <td>
                            <f:render partial="Compare/Information" section="recordInformation" arguments="{recordInformation:compareData.user.description}" />
                        </td>
                    </f:for>
                </tr>
                <tr>
                    <th><f:translate key="admin" /></th>
                    <f:for each="{compareUserList}" as="compareData">
                        <td>
                            <f:render partial="Compare/Information" section="yesno" arguments="{value:compareData.user.admin}" />
                        </td>
                    </f:for>
                </tr>
                <tr>
                    <th><f:translate key="disable_compare" /></th>
                    <f:for each="{compareUserList}" as="compareData">
                        <td>
                            <f:if condition="{onlineBackendUsers.{compareData.user.uid}}">
                                <f:else>
                                    <f:if condition="{compareData.user.disable}">
                                        <f:then>
                                            <a class="btn btn-default" href="{be:moduleLink(route:'tce_db', query:'data[be_users][{compareData.user.uid}][disable]=0', currentUrlParameterName:'redirect')}" title="{f:translate(key: 'visibility.unhide')}">
                                                <core:icon identifier="actions-edit-unhide" />
                                            </a>
                                        </f:then>
                                        <f:else>
                                            <a class="btn btn-default" href="{be:moduleLink(route:'tce_db', query:'data[be_users][{compareData.user.uid}][disable]=1', currentUrlParameterName:'redirect')}" title="{f:translate(key: 'visibility.hide')}">
                                                <core:icon identifier="actions-edit-hide" />
                                            </a>
                                        </f:else>
                                    </f:if>
                                </f:else>
                            </f:if>
                        </td>
                    </f:for>
                </tr>
                <tr>
                    <th><f:translate key="startDateAndTime" /></th>
                    <f:for each="{compareUserList}" as="compareData">
                        <td>
                            <f:if condition="{compareData.user.starttime}">
                                <f:then>
                                    <f:format.date format="{dateFormat} {timeFormat}">{compareData.user.starttime}</f:format.date>
                                </f:then>
                                <f:else>
                                    -
                                </f:else>
                            </f:if>
                        </td>
                    </f:for>
                </tr>
                <tr>
                    <th><f:translate key="endDateAndTime" /></th>
                    <f:for each="{compareUserList}" as="compareData">
                        <td>
                            <f:if condition="{compareData.user.endtime}">
                                <f:then>
                                    <f:format.date format="{dateFormat} {timeFormat}">{compareData.user.endtime}</f:format.date>
                                </f:then>
                                <f:else>
                                    -
                                </f:else>
                            </f:if>
                        </td>
                    </f:for>
                </tr>
                <tr>
                    <th><f:translate key="lastLogin" /></th>
                    <f:for each="{compareUserList}" as="compareData">
                        <td>
                            <f:if condition="{compareData.user.lastlogin}">
                                <f:then>
                                    <f:format.date format="{dateFormat} {timeFormat}">{compareData.user.lastlogin}</f:format.date>
                                </f:then>
                                <f:else>
                                    <f:translate key="never" />
                                </f:else>
                            </f:if>
                        </td>
                    </f:for>
                </tr>
                <tr>
                    <th><f:translate key="LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:be_groups.subgroup" /></th>
                    <f:for each="{compareUserList}" as="compareData">
                        <td>
                            <f:render partial="Compare/Information" section="groups" arguments="{groups:compareData.groups}" />

                        </td>
                    </f:for>
                </tr>
                <tr>
                    <th><f:translate key="allowedLanguages" /></th>
                    <f:for each="{compareUserList}" as="compareData">
                        <td>
                            <f:render partial="Compare/Information" section="languages" arguments="{languages:compareData.languages}" />
                        </td>
                    </f:for>
                </tr>
                <tr>
                    <th><f:translate key="dbMountPoints" /></th>
                    <f:for each="{compareUserList}" as="compareData">
                        <td>
                            <f:render partial="Compare/Information" section="dbMounts" arguments="{dbMounts:compareData.dbMounts}" />
                        </td>
                    </f:for>
                </tr>
                <tr>
                    <th><f:translate key="fileMounts" /></th>
                    <f:for each="{compareUserList}" as="compareData">
                        <td>
                            <f:render partial="Compare/Information" section="fileMounts" arguments="{fileMounts:compareData.fileMounts}" />
                        </td>
                    </f:for>
                </tr>
                <tr>
                    <th>{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:be_groups.fileoper_perms')}</th>
                    <f:for each="{compareUserList}" as="compareData">
                        <td>
                            <f:render partial="Compare/Information" section="fileFolderPermissions" arguments="{fileFolderPermissions:compareData.fileFolderPermissions}" />
                        </td>
                    </f:for>
                </tr>
                <tr>
                    <th>{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:be_groups.pagetypes_select')}</th>
                    <f:for each="{compareUserList}" as="compareData">
                        <td>
                            <f:render partial="Compare/Information" section="pageTypes" arguments="{pageTypes:compareData.pageTypes}" />
                        </td>
                    </f:for>
                </tr>
                <tr>
                    <th>{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:category_perms')}</th>
                    <f:for each="{compareUserList}" as="compareData">
                        <td>
                            <f:render partial="Compare/Information" section="categories" arguments="{categories:compareData.categories}"/>
                        </td>
                    </f:for>
                </tr>
                <tr>
                    <th>{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:TSconfig')}</th>
                    <f:for each="{compareUserList}" as="compareData">
                        <td>
                            <f:render partial="Compare/Information" section="tsconfig" arguments="{tsconfig:compareData.tsconfig,id:compareData.user.uid}" />
                        </td>
                    </f:for>
                </tr>
                <f:if condition="{compareUserList.0.workspaces}">
                    <tr>
                        <th>{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:workspace_perms')}</th>
                        <f:for each="{compareUserList}" as="compareData">
                            <td>
                                <f:render partial="Compare/Information" section="workspaces" arguments="{workspaces:compareData.workspaces}"/>
                            </td>
                        </f:for>
                    </tr>
                </f:if>
                <tr>
                    <th><f:translate key="disableIpLock" /></th>
                    <f:for each="{compareUserList}" as="compareData">
                        <td>
                            <f:render partial="Compare/Information" section="yesno" arguments="{value:compareData.user.disableIPlock}" />
                        </td>
                    </f:for>
                </tr>
            </tbody>
        </table>
    </div>
</f:section>
</html>
